package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMtngroupMapper;
import com.ruoyi.net.domain.ElementBusiMtngroup;
import com.ruoyi.net.service.IElementBusiMtngroupService;

/**
 * 网元-业务-mtngroupService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMtngroupServiceImpl implements IElementBusiMtngroupService 
{
    @Autowired
    private ElementBusiMtngroupMapper elementBusiMtngroupMapper;

    /**
     * 查询网元-业务-mtngroup
     * 
     * @param id 网元-业务-mtngroup主键
     * @return 网元-业务-mtngroup
     */
    @Override
    public ElementBusiMtngroup selectElementBusiMtngroupById(String id)
    {
        return elementBusiMtngroupMapper.selectElementBusiMtngroupById(id);
    }

    /**
     * 查询网元-业务-mtngroup列表
     * 
     * @param elementBusiMtngroup 网元-业务-mtngroup
     * @return 网元-业务-mtngroup
     */
    @Override
    public List<ElementBusiMtngroup> selectElementBusiMtngroupList(ElementBusiMtngroup elementBusiMtngroup)
    {
        return elementBusiMtngroupMapper.selectElementBusiMtngroupList(elementBusiMtngroup);
    }

    /**
     * 新增网元-业务-mtngroup
     * 
     * @param elementBusiMtngroup 网元-业务-mtngroup
     * @return 结果
     */
    @Override
    public int insertElementBusiMtngroup(ElementBusiMtngroup elementBusiMtngroup)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtngroup.getId())) {
            elementBusiMtngroup.setId(uuid);
        }
        elementBusiMtngroup.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtngroup.setCreateTime(DateUtils.getNowDate());
        elementBusiMtngroup.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtngroup.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtngroupMapper.insertElementBusiMtngroup(elementBusiMtngroup);
    }

    /**
     * 修改网元-业务-mtngroup
     * 
     * @param elementBusiMtngroup 网元-业务-mtngroup
     * @return 结果
     */
    @Override
    public int updateElementBusiMtngroup(ElementBusiMtngroup elementBusiMtngroup)
    {
        elementBusiMtngroup.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtngroup.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtngroupMapper.updateElementBusiMtngroup(elementBusiMtngroup);
    }

    /**
     * 批量删除网元-业务-mtngroup
     * 
     * @param ids 需要删除的网元-业务-mtngroup主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtngroupByIds(String[] ids)
    {
        return elementBusiMtngroupMapper.deleteElementBusiMtngroupByIds(ids);
    }

    /**
     * 删除网元-业务-mtngroup信息
     * 
     * @param id 网元-业务-mtngroup主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtngroupById(String id)
    {
        return elementBusiMtngroupMapper.deleteElementBusiMtngroupById(id);
    }
}
